Public Class frmCanDoiTaiKhoan_Ngay
    Private data As DataTable
    Private da As MySqlDataAdapter
    Dim sqlQuery As String

    Private Sub frmCanDoiTaiKhoan_Ngay_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        moduleUtils.setDinhDangVietNam()
        Me.TuNgay_DateTimePicker.Value = moduleUtils.getNgayDauThang(Today.Year, Today.Month)
        Me.DenNgay_DateTimePicker.Value = moduleUtils.getNgayCuoiThang(Today.Year, Today.Month)

    End Sub

    Private Sub btnInBaoCao_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInBaoCao.Click
        Dim myForm As FrmCrCanDoiTaiKhoan_Ngay = New FrmCrCanDoiTaiKhoan_Ngay
        myForm.setThang(CDate(Me.TuNgay_DateTimePicker.Value))
        myForm.setNam(CDate(Me.DenNgay_DateTimePicker.Value))
        myForm.Show()
    End Sub

    Private Sub btnThoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThoat.Click
        Me.Close()
    End Sub

    Private Sub btnXemCDTK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnXemCDTK.Click

        Me.Cursor = Cursors.WaitCursor
        Dim loadTonCDTK As Integer = tonghop.loadTonCDTK_Ngay(CDate(Me.TuNgay_DateTimePicker.Value), CDate(Me.DenNgay_DateTimePicker.Value))
        Me.Cursor = Cursors.Default

        If loadTonCDTK = 1 Then
            Dim sqlQuery = "SELECT * FROM tbl_dot_temp_toncdtk_Ngay  ORDER BY ma_taikhoan "
            Dim record As ArrayList = moduleDatabaseConn.loadDataTable(data, da, sqlQuery)
            da = record.Item(0)
            data = record.Item(1)
            Me.gridTonCDTK.DataSource = data
        End If
    End Sub

End Class